Imports Microsoft.VisualBasic

Public Class Category
    Inherits BaseEntity

    Private _CategoryName As String
    Public Property CategoryName() As String
        Get
            Return _CategoryName
        End Get
        Set(ByVal value As String)
            _CategoryName = value
        End Set
    End Property

    Private _CategoryGroupID As String
    Public Property CategoryGroupID() As String
        Get
            Return _CategoryGroupID
        End Get
        Set(ByVal value As String)
            _CategoryGroupID = value
        End Set
    End Property

    Public Overrides Function ToString() As String
        Dim buf As String = Me.ID & ", " & Me.CategoryName & ", " & Me.CategoryGroupID
        buf &= MyBase.ToString()
        Return buf
    End Function

    Public Overloads Function compareAndGetDiff(ByVal _NewObj As Category) As String
        Dim buf As String = ""
        If Me.CategoryName <> _NewObj.CategoryName Then
            buf &= "CategoryName=" & Me.CategoryName & " -> " & _NewObj.CategoryName & " "
        End If
      
        If Me.CategoryGroupID <> _NewObj.CategoryGroupID Then
            buf &= ", CategoryGroupID=" & CategoryGroupID & " -> " & _NewObj.CategoryGroupID & " "
        End If

        buf &= MyBase.compareAndGetDiff(_NewObj)
        Return buf
    End Function
End Class

